package cn.jiyun.controller;

import cn.jiyun.pojo.DeviationDistance;
import cn.jiyun.service.DeviationDistanceService;
import cn.jiyun.vo.ResultCommon;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/dev")
@CrossOrigin
public class DeviationDistanceController {
    @Autowired
    private DeviationDistanceService deviationDistanceService;
    @GetMapping("/findAll")
    public ResultCommon findAll(){
        List<DeviationDistance> deviationDistanceList = deviationDistanceService.findAll();
        return ResultCommon.suceessData(deviationDistanceList);
    }
    @PostMapping("/updatebyid")
    public ResultCommon updatebyid(@RequestBody DeviationDistance deviationDistance){
        deviationDistanceService.updateById(deviationDistance);
        return ResultCommon.suceess();
    }
}
